package com.anxin.act.busFlow.web;

import java.util.List;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.anxin.framework.aspectj.lang.annotation.Log;
import com.anxin.framework.aspectj.lang.enums.BusinessType;
import com.anxin.act.busFlow.entity.ConfigNodeKeyword;
import com.anxin.act.busFlow.service.ConfigNodeKeywordService;
import com.anxin.framework.web.controller.BaseController;
import com.anxin.framework.web.entity.AjaxResult;
import com.anxin.common.utils.poi.ExcelUtil;
import com.anxin.framework.web.page.TableDataInfo;

/**
 * 关键字列(业务流程提醒)Controller
 *
 * @author jbs
 * @date 2022-09-29
 */
//@Api(tags = "关键字列(业务流程提醒)" )
@RestController
@RequestMapping("/keyword/configNodeKeyword")
public class ConfigNodeKeywordController extends BaseController{
    @Autowired
    private ConfigNodeKeywordService configNodeKeywordService;

    /**
     * 查询关键字列(业务流程提醒)列表
     */
    //@ApiOperation(value="查询关键字列(业务流程提醒)列表" ,notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('node:keyword:view')")
    @GetMapping("/list")
    @Log(title = "查询关键字列(业务流程提醒)列表", businessType = BusinessType.LIST)
    public TableDataInfo<List<ConfigNodeKeyword>> list(ConfigNodeKeyword configNodeKeyword){
        startPage();
        List<ConfigNodeKeyword> list = configNodeKeywordService.findList(configNodeKeyword);
        return getDataTable(list);
    }

    /**
     * 导出关键字列(业务流程提醒)列表
     */
    //@ApiOperation(value="导出关键字列(业务流程提醒)列表",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('node:keyword:export')")
    @Log(title = "关键字列(业务流程提醒)", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ConfigNodeKeyword configNodeKeyword) {
        List<ConfigNodeKeyword> list = configNodeKeywordService.findList(configNodeKeyword);
        ExcelUtil<ConfigNodeKeyword> util = new ExcelUtil<ConfigNodeKeyword>(ConfigNodeKeyword.class);
        return util.exportExcel(list, "keyword");
    }

    /**
     * 获取关键字列(业务流程提醒)详细信息
     */
    //@ApiOperation(value="获取关键字列(业务流程提醒)详细信息",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('node:keyword:view')")
    @GetMapping(value = "/{id}")
    @Log(title = "获取关键字列(业务流程提醒)详细信息", businessType = BusinessType.LIST)
    public AjaxResult<ConfigNodeKeyword> getInfo(@PathVariable("id") String id){
        return AjaxResult.success(configNodeKeywordService.getById(id));
    }

    /**
     * 保存关键字列(业务流程提醒)
     */
    //@ApiOperation(value="保存关键字列(业务流程提醒)",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('node:keyword:edit')")
    @Log(title = "关键字列(业务流程提醒)", businessType = BusinessType.INSERT)
    @PostMapping("/save")
    public AjaxResult save(@RequestBody ConfigNodeKeyword configNodeKeyword){
        configNodeKeywordService.save(configNodeKeyword);
        return AjaxResult.success(configNodeKeyword);
    }


    /**
     * 删除关键字列(业务流程提醒)
     */
    //@ApiOperation(value="删除关键字列(业务流程提醒)",notes="作者:jbs")
    @PreAuthorize("@ss.hasPermi('node:keyword:remove')")
    @Log(title = "关键字列(业务流程提醒)", businessType = BusinessType.DELETE)
	@DeleteMapping("/{id}")
    public AjaxResult delete(@PathVariable(("id")) String id){
        return toAjax(configNodeKeywordService.deleteById(id));
    }
}
